package meconsea.life.admin.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import meconsea.life.sys.entity.AbsEntity;

import org.hibernate.annotations.Type;


@SuppressWarnings("serial")
@Entity
@Table(name="CMS_ART_CLS")
@NamedQueries({
	@NamedQuery(name=Indicate.FIND_IN_CLSCODE,query="SELECT O FROM Indicate O where O.clsCode=:clsCode order by O.clsOrder "),
	@NamedQuery(name=Indicate.FIND_IN_CLSCODES,query = "SELECT O FROM Indicate O where O.clsCode in (:clsCodeList) "),
	@NamedQuery(name=Indicate.FIND_IN_PARENT,query="SELECT O FROM Indicate O where O.parentCls=:parentCls order by O.clsOrder "),
	@NamedQuery(name=Indicate.FIND_IN_SAME_LEVEL,query="SELECT O FROM Indicate O where O.parentCls=:parentCls and O.clsOrder>:clsOrder order by O.clsOrder"),
	@NamedQuery(name=Indicate.FIND_IN_CHILD,query="SELECT O FROM Indicate O where O.clsLevel<:clsLevel and O.clsOrder>:clsOrder order by O.clsOrder"),
	@NamedQuery(name = Indicate.FIND_IN_MAXORDER,query = "SELECT O FROM Indicate O order by O.clsOrder desc ")
})
public class Indicate extends AbsEntity {
	public static final String FIND_IN_PARENT = "in_find_parent";
	public static final String FIND_IN_CLSCODE = "in_find_clscode";
	public static final String FIND_IN_CHILD = "in_find_child";
	public static final String FIND_IN_SAME_LEVEL = "in_find_same_level";
	public static final String FIND_IN_MAXORDER = "in_find_maxorder";
	public static final String FIND_IN_CLSCODES = "in_find_clscodes";
	@Column(name="clsCode",length=64)
	private String clsCode;
	
	@Column(length=128)
	private String clsName;
	
	@Column(length=64)
	private String parentCls;
	
	@Column(name="clsLevel")
	@Type(type="integer")
	private int clsLevel;
	
	@Column(name="clsOrder")
	@Type(type="integer")
	private int clsOrder;
	
	@Column(length=256)
	private String clsPath;

	public String getClsCode() {
		return clsCode;
	}

	public void setClsCode(String clsCode) {
		this.clsCode = clsCode;
	}

	public String getClsName() {
		return clsName;
	}

	public void setClsName(String clsName) {
		this.clsName = clsName;
	}

	public String getParentCls() {
		return parentCls;
	}

	public void setParentCls(String parentCls) {
		this.parentCls = parentCls;
	}

	public int getClsLevel() {
		return clsLevel;
	}

	public void setClsLevel(int clsLevel) {
		this.clsLevel = clsLevel;
	}

	public int getClsOrder() {
		return clsOrder;
	}

	public void setClsOrder(int clsOrder) {
		this.clsOrder = clsOrder;
	}

	public String getClsPath() {
		return clsPath;
	}

	public void setClsPath(String clsPath) {
		this.clsPath = clsPath;
	}
	
	
}
